import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import service.UserService;
import service.UserServiceImpl;

public class Mytest {

    @Test
    public void test(){
        //第一步，注册IoC容器
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        //第二步，用什么对象，拿什么对象
        //动态代理，代理的是接口
        UserService userService = ac.getBean("userService", UserService.class);
        //第三步，调用方法
        userService.add();

    }
}
